<div class="opaque">
<?php echo $form->create('config',array('id'=>'config')); ?>
<p>
<?php
echo $form->label('theme',__('Choose the default theme',true));
echo $form->select('theme',$themes,$defaulttheme);
?>
</p>
<p>
<?php
echo $form->input('websitename',array('div'=>false,'label'=>__('Name of the website',true)));
?>
</p>
<p><?php
echo $form->label('mapsystem',__('Choose your map system',true));
echo $form->select('Mapsystem',array('url'=>__('URL (like dynmap)',true),'images'=>__('Images (like mcmap)',true)),$mapsystem,array('div'=>false,'onchange'=>'toggleMapSystem();')); ?></p>
<div id="mapsystemdiv" class='divconfigpanel' <?php echo $displaymapdiv; ?>>
<?php echo $form->input('Mapsystemparam',array('div'=>false,'label'=>__('Parameters :',true))); __('Parameters for map system.');?><br/>
<?php __('URL : Give the complete URL (ie. for dynamp http://192.168.1.103:8123/).'); echo '<br/>';
__('Images : Give the name of the file image, the file MUST BE in /maps/images/ (ie. output.png).');?>

</div>
<p><?php echo $form->input('MinecraftPath',array('div'=>false)); __('Path for minecraft');?><br/><?php echo $mcpathmessage;?></p>
<p>
<?php
echo $form->label('useTcpBukkit','Use TcpBukkit ?');
echo $form->checkbox('useTcpBukkit',array('div'=>false,'id'=>'useTcpBukkit','onclick'=>'toggleTCP();','checked'=>$this->data['config']["useTcpBukkit"]));  __('Check if you want to use TCPBukkit');?></p>
<div id='tcpbukkitdiv' class='divconfigpanel' <?php echo $displaydivBukkit;?>>
<?php echo $form->input('TcpBukkitServer',array('div'=>false));  __('Address of Minecraft server (ie : localhost or fqdn)');?><br/>
<?php echo $form->input('TcpBukkitPort',array('div'=>false));  __('Port of the TCPBukkit plugin (default : 6790)');?><br/>
<?php echo $form->input('TcpBukkitPassword',array('div'=>false));  __('Password for TCPBukkit plugin (default : password)');?><br/>
</div>
<p>
<?php
echo $form->label('useRemoteToolkit','Use RemoteToolkit ?');
echo $form->checkbox('useRemoteToolkit',array('div'=>false,'id'=>'useRemoteToolkit','onclick'=>'toggleRT();','checked'=>$this->data['config']["useRemoteToolkit"]));  __('Check if you want to use Remote Toolkit');?></p>
<div id='remotetoolkitdiv' class='divconfigpanel' <?php echo $displaydivRT; ?>>
<?php echo $form->input('RemoteToolkitServer',array('div'=>false));  __('Address of Minecraft server (ie : localhost or fqdn)');?><br/>
<?php echo $form->input('RemoteToolkitPort',array('div'=>false));  __('Port of the Remote Toolkit plugin (default : 25561)');?><br/>
<?php echo $form->input('RemoteToolkitUser',array('div'=>false));  __('Password for Remote Toolkit plugin (default : user)');?><br/>
<?php echo $form->input('RemoteToolkitPassword',array('div'=>false));  __('Password for Remote Toolkit plugin (default : pass)');?><br/>
</div>
<p>
<?php 
echo $form->label('usePermissionsPlugin','Use Permissions plugin ?');
echo $form->checkbox('usePermissionsPlugin',array('div'=>false,'id'=>'usePermissionsPlugin','onclick'=>'togglePP();','checked'=>$this->data['config']["usePermissionsPlugin"])); __('Check if you want to use Permissions plugin');?></p>
<div id='ppdiv' class='divconfigpanel' <?php echo $displaydivPP; ?>>
<?php 
if (!empty($ppworlds))
{
	echo $form->label('ppworlds','Select the world :');
	echo $form->select('ppdefaultworld',$ppworlds,$ppdefaultworld,array('empty'=>TRUE));
	__("Default world for registered users<br/>");
}
else
	__("No Permissions Plugin detected or worlds not declared!<br/>");

$js->get('#configPpdefaultworld');
echo $js->event
		('change',
		$js->request(array('controller'=>'plugins','action'=>'getPPGroups'),array('method'=>'post','dataExpression'=>true,'data'=>'{world:$("#configPpdefaultworld").val()}','type'=>'json','success'=>'refreshGroupPP(data);'))
		);

/*if (!empty($ppgroups))
{*/
	echo $form->label('ppdefaultgroup','Select the group :');
	echo $form->select('ppdefaultgroup',$ppgroups,$ppdefaultgroup,array('empty'=>false));
	__("Default group for registered users<br/>");
/*}
else
	__("No Permissions Plugin detected or groups not declared!<br/>");*/
?>
</div>
<p>
<center>
<?php
echo $js->submit('Save',array('div'=>false,'url'=>array('action'=>'save_config'),'id'=>'saveConfig','update'=>'#content','complete' => 'saveUI();','confirm'=>__('Are you sure ?',true)));
?>
</center></p>
<?php echo $form->end(); ?>
</div>